from sklearn.datasets import load_wine
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier

if __name__ == '__main__':
    wine = load_wine()
    x_train, x_test, y_train, y_test = train_test_split(wine.data, wine.target)
    clf = DecisionTreeClassifier(criterion='entropy')
    clf.fit(x_train, y_train)
    train_score = clf.score(x_train, y_train)
    test_score = clf.score(x_test, y_test)
    print(f'train score: {train_score}, test score: {test_score}')
